From 88fb0faedf5c4d25d8950b11e7b597063f6a4d7a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 14 Sep 2002 17:35:19 +0000 Subject: [PATCH] (display-warning): In batch mode, exclude the final newline from the arg to `message'. --- lisp/warnings.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/warnings.el b/lisp/warnings.el index 07075fa970c..99f345baa55 100644 --- a/lisp/warnings.el +++ b/lisp/warnings.el @@ -257,7 +257,13 @@ See also `warning-series', `warning-prefix-function' and ;; Do this unconditionally, since there is no way ;; to view logged messages unless we output them. (with-current-buffer buffer - (message "%s" (buffer-substring start end))) + (save-excursion + ;; Don't include the final newline in the arg + ;; to `message', because it adds a newline. + (goto-char end) + (if (bolp) + (forward-char -1)) + (message "%s" (buffer-substring start (point))))) ;; Interactively, decide whether the warning merits ;; immediate display. (or (< (warning-numeric-level level) -- 2.30.2